﻿using System;
using UnityEngine;

// Token: 0x0200060D RID: 1549
public class ChangePtnAnime : MonoBehaviour
{
	// Token: 0x06002516 RID: 9494 RVA: 0x0014380C File Offset: 0x00141A0C
	public virtual void Start()
	{
	}

	// Token: 0x06002517 RID: 9495 RVA: 0x00143810 File Offset: 0x00141A10
	public virtual void Init(Texture[] tex)
	{
		this.TexChange = new Texture[tex.Length];
		for (int i = 0; i < tex.Length; i++)
		{
			this.TexChange[i] = tex[i];
		}
	}

	// Token: 0x06002518 RID: 9496 RVA: 0x0014384C File Offset: 0x00141A4C
	public virtual void Update()
	{
		if (base.GetComponent<Renderer>())
		{
			int num = (int)((long)((double)Time.timeSinceLevelLoad * 1000.0) % 1000000L) / this.ChangeTime;
			if (this.MatChange != null && this.MatChange.Length != 0)
			{
				int num2 = num % this.MatChange.Length;
				if (this.indexM != num2)
				{
					this.indexM = num2;
					base.GetComponent<Renderer>().sharedMaterial = this.MatChange[this.indexM];
				}
			}
			if (this.TexChange != null && this.TexChange.Length != 0)
			{
				int num3 = num % this.TexChange.Length;
				if (this.indexT != num3)
				{
					this.indexT = num3;
					base.GetComponent<Renderer>().material.mainTexture = this.TexChange[this.indexT];
				}
			}
		}
	}

	// Token: 0x04002D1A RID: 11546
	public Material[] MatChange;

	// Token: 0x04002D1B RID: 11547
	public Texture[] TexChange;

	// Token: 0x04002D1C RID: 11548
	public int ChangeTime = 200;

	// Token: 0x04002D1D RID: 11549
	protected int indexT;

	// Token: 0x04002D1E RID: 11550
	protected int indexM;
}
